<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <html> 
<head> 
	
	<meta name="viewport" content="width=device-width, initial-scale=1"> 
	<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
	<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
	<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Insert title here</title>
<html>
    <%@ page import="java.sql.*" %>
    <%@ page import="java.io.*" %> 

<%
 String driver="com.mysql.jdbc.Driver";
Class.forName(driver).newInstance();
Connection con=null;

 Statement st=null;
 ResultSet result=null;
 ResultSet result2=null;
 
 String id;
 id=request.getParameter("id");

 con= DriverManager.getConnection("jdbc:mysql://localhost:3306/ghine","root","25955103");
 st=con.createStatement();
 	
 result=st.executeQuery("Select * from forum_question where id='"+id+"'");
 String name="";
 
 
  

%>
</head>
<body>
<ul data-role="listview" data-theme="g">
	<% 
	if(result.next()){ %>
	
	<label for="topic">Topic:</label>
	<li id="topic"><%out.print(result.getString("topic"));%></li>
	
	<label for="detail">Detail:</label>
	<li id="detail"><%out.print(result.getString("detail"));%></li>
	
	
	<label for="email">Email:</label>
	<li id="email"><%out.print(result.getString("name"));%></li>
	
	<label for="DateTime">Date/Time</label>
	<li id="DateTime"><%out.print(result.getString("datetime"));%></li>
	
	
	
	<%
	}
	%>
</ul>
<%
id=request.getParameter("id");
result2=st.executeQuery("select * from forum_anwser where question_id='"+id+"'");




%>
<%
while(result2.next())
{

%>

<%out.println("-------------------------------");%>
<div class="ui-grid-b">
	<div class="ui-block-a">id: </div>
	
	<div class="ui-block-b"><% out.print(result2.getString("a_id")); %></div>
	<div class="ui-block-c">
	  <input type="submit" data-theme="b" value="submit" width="25%"></button>
	  </div>
	
</div><!-- /grid-b -->
<div class="ui-grid-a">
	<div class="ui-block-a">Name: </div>
	
	<div class="ui-block-b"><% out.print(result2.getString("a_name")); %></div>
	
</div><!-- /grid-b -->

<div class="ui-grid-a">
	<div class="ui-block-a">Email: </div>
	
	<div class="ui-block-b"><% out.print(result2.getString("a_email")); %></div>
	
</div><!-- /grid-b -->

<div class="ui-grid-a">
	<div class="ui-block-a">Answer: </div>
	
	<div class="ui-block-b"><% out.print(result2.getString("a_answer")); %></div>
	
</div><!-- /grid-b -->

<div class="ui-grid-a">
	<div class="ui-block-a">Datetime: </div>
	
	<div class="ui-block-b"><% out.print(result2.getString("a_datetime")); %></div>
	
</div><!-- /grid-b -->




<%
out.print("<br> ");
}
con.close();
%>
<br>
aakn
<form action="Add_AnswerPath"  method="post">
 <input type="hidden" name="id" id="basic" value="<% out.println(id); %>"  width="30%" />
				<label for="a_name">Name</label>
			    <input type="text" name="a_name" id="basic" value=""  width="30%" />
			    
			    <label for="a_email">email</label>
			    <input type="text" name="a_email" id="basic" value=""  width="30%" />
			    
			      <label for="a_answer">answer</label>
			    <input type="text" name="a_answer" id="basic" value=""  width="30%" />
			    
			    <input type="submit" data-theme="b" value="submit" width="25%"></button>	
			    
			    
			    
  </form>
			    
			    
			    
			    
</body>
</html>